Tester 2 Click
Tester 2 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.
Click Library
- Author : Stefan Filipovic
- Date : Sep 2024.
- Type : GPIO type
Software Support
Example Description
This example demonstrates the use of Tester 2 Click board by controlling all LEDs on the Click board together and in sequential pin toggling with different delays.
Example Libraries
- MikroSDK.Board
- MikroSDK.Log
- Click.Tester2
Example Key Functions
- tester2_cfg_setup Config Object Initialization function.
void tester2_cfg_setup(tester2_cfg_t *cfg)
Tester 2 configuration object setup function.
Tester 2 Click configuration object.
Definition tester2.h:115
- tester2_init Initialization function.
err_t tester2_init(tester2_t *ctx, tester2_cfg_t *cfg)
Tester 2 initialization function.
Tester 2 Click context object.
Definition tester2.h:94
- tester2_toggle_all This function toggles all mikroBUS pins together a desired number of times with the selected delay between each toggle.
void tester2_toggle_all(tester2_t *ctx, uint16_t num_toggles, uint16_t toggle_delay_ms)
Tester 2 toggle all function.
- tester2_toggle_seq This function toggles all mikroBUS pins one by one with the selected delay between each toggle.
void tester2_toggle_seq(tester2_t *ctx, uint16_t toggle_delay_ms)
Tester 2 toggle seq function.
Application Init
Initializes the driver and logger.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
if ( DIGITAL_OUT_UNSUPPORTED_PIN ==
tester2_init( &tester2, &tester2_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define TESTER2_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition tester2.h:72
void application_init(void)
Definition main.c:33
#define MIKROBUS_POSITION_TESTER2
Definition main.c:27
Application Task
Toggles all pins together 5 times with a 500ms delay between each toggle, then toggles each pin sequentially with a 300ms delay between toggling each pin.
{
log_printf( &logger, " Toggling all pins together 5 times with 500ms delay\r\n\n" );
log_printf( &logger, " Toggling all pins sequentially with 300ms delay\r\n\n" );
}
void application_task(void)
Definition main.c:63
Application Output
This Click board can be interfaced and monitored in two ways:
- Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
- UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.
Additional Notes and Information
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.